#pragma once

#include "core/noncopy.h"
#include "fileio_common.h"

namespace renderit
{
	namespace fileio
	{
		class ifile : public core::noncopy
		{
		public:
			virtual ~ifile() {}

		public:
			//! close and release `this ifile`
			virtual void close() = 0;

		public:
			//! get size of file
			virtual long long size() = 0;

			//! read to buf
			virtual int read(char * buf, int size) = 0;

			//! write from buf
			virtual bool write(const char * buf, int size) = 0;

			//! seek
			virtual bool seek(long long offset, ESeekSet where) = 0;

			//! get current position
			virtual long long cur_pos() = 0;
		};
	}
}